<?php

namespace Common\Model;

use Think\Model\RelationModel;

/**
 * 作品模型
 */
class WorksModel extends RelationModel {

    protected $_auto = array(
        array('add_time', 'time', self::MODEL_INSERT, 'function'), // 对add_time字段在添加的时候写入当前时间戳
    );
    protected $_link = array(
        'Designer' => array(
            'mapping_type' => self::BELONGS_TO,
            'class_name' => 'Designer',
            'foreign_key' => 'did',
            'mapping_name' => 'designer',
            'mapping_fields' => 'dname,sid',
            'as_fields' => 'dname,sid'
        )
    );

}

?>
